package com.heima.behavior.controller;

import com.heima.behavior.dtos.CollectionBehaviorDto;
import com.heima.behavior.dtos.LikesBehaviorDto;
import com.heima.behavior.dtos.UnLikesBehaviorDto;
import com.heima.behavior.service.ApLikesBehaviorService;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1")
public class ApUnLlikesBehaviorController {

    @Autowired
    private ApLikesBehaviorService apLikesBehaviorService;

    /**
     * 喜欢/不喜欢
     * @param dto
     * @return
     */
    @PostMapping("/un_likes_behavior")
    public ResponseResult unLikes(@RequestBody UnLikesBehaviorDto dto) {
        return apLikesBehaviorService.unLikes(dto);
    }

    /**
     * 收藏
     * @param dto
     * @return
     */
    @PostMapping("/collection_behavior")
    public ResponseResult collection(@RequestBody CollectionBehaviorDto dto) {
        return apLikesBehaviorService.collection(dto);
    }
}
